import matplotlib.pyplot as plt
import numpy as np
from test0 import create_coordinate_system

# 创建一个坐标系
fig, ax = create_coordinate_system(x_range=(-10, 10), y_range=(-4, 10), figsize=(8, 6))

# 添加一个二次函数的图像
x = np.linspace(-5.5, -0.5, 100)
y = (x+3)**2 - 2 

# 向右平移6个单位，(x + 3) - 6 = x - 3
x1 = np.linspace(0.5, 5.5, 100)
y1 = (x1-3)**2 - 2 

# 绘制二次函数的图像
ax.plot(x, y, 'r-', linewidth=2, label='y = f(x)', color='black')
ax.plot(x1, y1, 'r-', linewidth=2, label='y = f(x-m)', color='red')

ax.legend()
plt.show()
